package com.yjd.comm.vo;

import com.yjd.comm.util.StringUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 常量集合
 * 
 * @author ready
 * 
 */
public class Constant {
	/**
	 * 数据库类型
	 * 
	 */
	public static class DbTypes {

		/**
		 * 目前支持的数据库类型
		 * 
		 */
		public enum DbTypeEnum {
			ORACLE("oracle"), SQLSERVER("sqlserver"), MYSQL("mysql");
			private String value;

			DbTypeEnum(String value) {
				this.value = value;
			}

			public String getValue() {
				return value;
			}

			public void setValue(String value) {
				this.value = value;
			}
		}

		// 支持的数据库类型列表,目前只支持oracle，sqlserver，mysql
		public static List<String> dbTypeList = new ArrayList<String>();
		static {
			dbTypeList.add(DbTypeEnum.ORACLE.getValue());
			dbTypeList.add(DbTypeEnum.SQLSERVER.getValue());
			dbTypeList.add(DbTypeEnum.MYSQL.getValue());
		}

		/**
		 * 数据库是否是oracle
		 * 
		 * @param dbType
		 * @return
		 */
		public static boolean isOracle(String dbType) {
            return StringUtil.isNotEmpty(dbType)
                    && DbTypeEnum.ORACLE.getValue().equals(dbType);
        }

		/**
		 * 数据库是否是sqlserver
		 * 
		 * @param dbType
		 * @return
		 */
		public static boolean isSqlserver(String dbType) {
            return StringUtil.isNotEmpty(dbType)
                    && DbTypeEnum.SQLSERVER.getValue().equals(dbType);
        }

		/**
		 * 数据库是否是mysql
		 * 
		 * @param dbType
		 * @return
		 */
		public static boolean isMysql(String dbType) {
            return StringUtil.isNotEmpty(dbType)
                    && DbTypeEnum.MYSQL.getValue().equals(dbType);
        }
	}

	/**
	 * 操作结果主要的几个类型(1000：成功，1001：失败，1002：系统异常，1003：没有登录， 1004：无权访问，404:没有找到该页面)
	 * 
	 * @author Ready 2012-10-17
	 */
	public enum ResultEnum {
		// 成功,失败,没有登录,无权限,其他
		ERROR("0", "ERROR"), SUCCESS("1", "SUCCESS"), SYSEXCEPTION("1002",
				"SYSEXCEPTION"), NOLOGIN("1003", "NOLOGIN"), NOPERMISSION(
				"1004", "NOPERMISSION"), NOTFINDPAGE("404", "没有找到该页面");
		private String result;

		private String desc;

		ResultEnum(String result, String desc) {
			this.result = result;
			this.desc = desc;
		}

		public String getResult() {
			return result;
		}

		public void setResult(String result) {
			this.result = result;
		}

		public String getDesc() {
			return desc;
		}

		public void setDesc(String desc) {
			this.desc = desc;
		}

		@Override
		public String toString() {
			return this.result;
		}
	}

	/**
	 * 内容类型
	 * 
	 */
	public enum ContentTypeEnum {
		TEXT_HTML("text/html; charset=UTF-8"), TEXT_PLAIN(
				"text/plain; charset=UTF-8"), TEXT_JSON(
				"text/json; charset=UTF-8");
		String value;

		ContentTypeEnum(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	/**
	 * servle中的范围枚举
	 * 
	 * @author Ready 2012-10-17
	 */
	public enum HttpScopeEnum {

		REQUEST("request"), SESSION("session"), APPLICATION("application");
		private String scope;

		HttpScopeEnum(String scope) {
			this.scope = scope;
		}

		public String getScope() {
			return scope;
		}

		public void setScope(String scope) {
			this.scope = scope;
		}
	}

	/**
	 * 系统一些资源文件名称
	 * 
	 * @author ready
	 * 
	 */
	public enum PropertiesFileEnum {

		WEB("web.properties"), CONST("const.properties"), RPM_SERVICE("rpm_service.properties"), DEFAULT(
				"default.properties");

		private String filename;

		public String getFilename() {
			return filename;
		}

		public void setFilename(String filename) {
			this.filename = filename;
		}

		PropertiesFileEnum(String filename) {
			this.filename = filename;
		}
	}

	/**
	 * 文件系统类型
	 * 
	 * @author ready
	 * 
	 */
	public enum FsTypeEnum {
		FTP, WEB
    }

	/**
	 * 文件服务类型
	 * 
	 * @author ready
	 * 
	 */
	public enum FsServiceTypeEnum {
		DEFAULT
    }

	/**
	 * 短信模板编码
	 * 
	 * @author ready
	 * @date 2014-8-7
	 */
	public enum SmsTemplateCodeEnum {
		SMS_TEMPLATE_DEMO("建周短信测试"), SMS_CN_DEMO("中国短信网短信测试"), SMS_TEMPLATE_USER_REGISTOR(
				"用户注册短信"), SMS_TEMPLATE_MOBILE_BIND("手机绑定"), SMS_TEMPLATE_MOBILE_UNBIND(
				"手机解绑"), SMS_TEMPLATE_MOBILE_ADDPAYPWD("设置交易密码"), SMS_TEMPLATE_MOBILE_MODIFYPAYPWD(
				"修改交易密码"), SMS_TEMPLATE_REPAY_NOTICE_TO_INVESTOR("投资人收到还款的短信"), SMS_PASSWORD_REGAIN(
				"密码找回"), SMS_TEMPLATE_INVEST_BORROW("成功投标通知"), SMS_TEMPLATE_AUDIT4_SUCCESS_BORROWER(
				"满标审核通过给借款人发送短信"), SMS_TEMPLATE_AUDIT4_SUCCESS_INVESTOR(
				"满标审核通过给投资人发送短信"), SMS_TEMPLATE_REPAY_SUCCESS_TO_BORROW(
				"借款人每笔还款成功以后给借款人发送的短信"), SMS_TEMPLATE_REPAY_SUCCESS_TO_ADMIN(
				"借款人每笔还款成功以后给领导发送的短信"), SMS_TEMPLATE_REPAY_SUCCESS_TO_INVESTOR_1(
				"借款人每笔还款成功以后给投资人发送的短信(非最后一期)"), SMS_TEMPLATE_REPAY_SUCCESS_TO_INVESTOR_2(
				"借款人每笔还款成功以后给投资人发送的短信(最后一期)"), SMS_TEMPLATE_CREDITOR_TRANSFER_SUCCESS_TO_TRANSFER(
				"债权转让成功以后给转让人发送的短信"), SMS_TEMPLATE_CREDITOR_TRANSFER_SUCCESS_TO_BUYER(
				"债权转让成功以后给购买人发送的短信"), SMS_RECHARGE_TEMPLATE("充值短信"), SMS_TEMPLATE_ADVANCE_SUCCESS_TO_ADMIN(
				"垫付成功以后给领导发送的短信"), SMS_TEMPLATE_URG_EREPAY_NOTICE_TO_ADMIN_0(
				"敦促借款人还款提醒（未逾期情况）"), SMS_TEMPLATE_URG_EREPAY_NOTICE_TO_ADMIN_1(
				"敦促借款人还款提醒（逾期情况）"), SMS_SALARY_TEMPLATE("代发工资"), SMS_SALARY_ACTIVITE_PWD(
				"工资卡激活发送用户登录密码"), SMS_CASH_CHECK_TEMPLATE("提现审核通知"), SMS_CASH_FINISH_TEMPLATE(
				"提现完成通知"), SMS_CASH_REFUSE_TEMPLATE("提现拒绝通知"), SMS_SALARY_ACTIVITE(
				"工资卡激活发送用户通知"), SMS_SALARY_PROFITCOUNT_JOB("工资卡利息统计通知"), SMS_SALARY_PROFITSEND_JOB(
				"工资卡利息发送通知"), WAL_PROFITCOUNT_JOB("小钱包利息统计通知"), GOLD_PROFITCOUNT_JOB("小金库利息统计通知"),
				SMS_TEMPLATE_VOICE("语音短信"),SMS_TEMPLATE_VOICE_NOW("语音短信-立即发送"),
				SMS_TEMPLATE_GENERAL("通用短信"),SMS_TEMPLATE_GENERAL_NOW("通用短信-立即发送"),
				ACTIVITY8888DAY4("8888活动第四天提醒"), ACTIVITY8888DAY8("8888活动第八天提醒"), BORROW_REPAYMENT_NOTICE("提前还款通知"), WAL_OFFLINE_ANNONCE(
				"小钱包下线通知"), WAL_OFFLINE_EXP_ANNONCE("小钱包下线，体验金发放通知"),
				SMS_TEMPLATE_NEW_BORROW_TO_SUBSCRIBE_VOLUME_USER("给预约券用户发送新标预告"),
		        SMS_BANK_DEPO_CASH_FINISH_TEMPLATE("存管用户提现申请成功"),SMS_BANK_DEPO_CASH_REFUSE_TEMPLATE("存管用户提现退回"),
		         SMS_BANK_DEPO_RECHARGE_TEMPLATE("存管用户充值短信");
		SmsTemplateCodeEnum(String description) {
			this.description = description;
		}

		private String description;

		public String getDescription() {
			return description;
		}
	}

	/**
	 * 短信通道编码
	 * 
	 * @author ready
	 * @date 2014-8-7
	 */
	public enum SmsChannelCodeEnum {
		SMS_CHANNEL_JIANZHOU("SMS_CHANNEL_JIANZHOU","建周短信"), SMS_CHANNEL_CN("SMS_CHANNEL_CN","中国短信"), SMS_CHANNEL_WODONGKEJI(
				"SMS_CHANNEL_WODONGKEJI","沃动科技短信"),SMS_CHANNEL_CHUANLAN_YUYIN("SMS_CHANNEL_CHUANLAN_YUYIN","创蓝语音短信"),
				SMS_CHANNEL_MONTNETS("SMS_CHANNEL_MONTNETS","梦网短信"),SMS_CHANNEL_MONTNETS_MARKETING("SMS_CHANNEL_MONTNETS_MARKETING","梦网营销短信"),
		SMS_CHANNEL_MAIXUANKEJI("SMS_CHANNEL_MAIXUANKEJI","麦轩科技短信");
		SmsChannelCodeEnum(String code, String description) {
			this.description = description;
			this.code=code;
		}

		private String code;
		private String description;

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public String getDescription() {
			return description;
		}

	}

	/**
	 * job的log状态
	 * 
	 * @author ready
	 * @date 2014-8-8
	 */
	public enum JobLogStatusEnum {
		SUCCESS(1), FAIL(0);
		private Integer status;

		JobLogStatusEnum(Integer status) {
			this.status = status;
		}

		public Integer getStatus() {
			return status;
		}
	}

	/**
	 * @ClassName: SysParamKeyEnum
	 * @Description: 系统参数key
	 * @author ready likun_557@163.com
	 * @date 2014-8-15 下午4:06:37
	 */
	public enum SysParamKeyEnum {
		MAIL_CONFIG("MAIL_CONFIG","邮件配置"),
		MSG_CODE_VALID_TIME("MSG_CODE_VALID_TIME","短信验证码有效期"),
		SMS_SEND_TEST("SMS_SEND_TEST", "是否启用短信发送测试功能"),
		SMS_SEND_TEST_MOBILE_LIST("SMS_SEND_TEST_MOBILE_LIST", "测试手机号码列表(之间用分号隔开)"),
		MARKET_SMS_CHANNEL("MARKET_SMS_CHANNEL","营销短信发送渠道"),
		MARKET_SIGNATURE("MARKET_SIGNATURE","发送营销短信的签名"),

		/*医美分期商户端 start*/
		PUSH_TPL_ORDER_PROCESS_REMINDER("PUSH_TPL_ORDER_PROCESS_REMINDER","订单处理推送信息"),
		PUSH_TPL_CHARGEBACK_PROCESS_REMINDER("PUSH_TPL_CHARGEBACK_PROCESS_REMINDER","退单处理推送信息"),
		/*医美分期商户端 end*/

		/*医美分期 start*/
		PUSH_TPL_REPAYMENT_REMINDER("PUSH_TPL_REPAYMENT_REMINDER","还款提醒推送信息"),
		PUSH_TPL_REPAYMENT_REMINDER_FC("PUSH_TPL_REPAYMENT_REMINDER_FC","还款提醒推送信息（资金渠道）"),
		PUSH_TPL_OVER_DUE_REMINDER("PUSH_TPL_OVER_DUE_REMINDER","逾期提醒推送信息"),
		PUSH_TPL_MERCHANT_CONFIRM("PUSH_TPL_MERCHANT_CONFIRM", "商户确认订单推送消息"),
		PUSH_TPL_MERCHANT_CANCEL("PUSH_TPL_MERCHANT_CANCEL", "商户拒绝推送消息"),
		PUSH_TPL_FUNDCHANNEL_REFUSE("PUSH_TPL_FUNDCHANNEL_REFUSE", "资金方审核拒绝推送消息"),
		PUSH_TPL_REFUND_PASS("PUSH_TPL_REFUND_PASS", "退款通过推送消息"),
		PUSH_TPL_REFUND_REFUSE("PUSH_TPL_REFUND_REFUSE", "退款拒绝推送消息"),
		PUSH_TPL_REPAYMENT_SUCCESS("PUSH_TPL_REPAYMENT_SUCCESS", "还款成功推送消息"),
		PUSH_TPL_CREDIT_LINE_CHANGED("PUSH_TPL_CREDIT_LINE_CHANGED", "额度申请推送消息"),
		PUSH_TPL_REPAYMENT_FAIL("PUSH_TPL_REPAYMENT_FAIL", "还款失败推送消息"),
		PUSH_TPL_LOAN_APPLY_PASS("PUSH_TPL_LOAN_APPLY_PASS", "贷款申请审核通过推送消息"),

		OVERDUE_MANAGER_FEE_SWITCH("OVERDUE_MANAGER_FEE_SWITCH", "逾期管理费开关"), //（0 关闭 1 打开）
		REPAYMENT_SWITCH("REPAYMENT_SWITCH", "还款开关"), //（0 关闭还款功能 1 打开还款功能）

		DOCTORTITL("DOCTORTITL","医生职位等级"),
		ORGANIZATION_TYPE("ORGANIZATION_TYPE","机构类型"),
		SMS_CONFIG("SMS_CONFIG", "短信配置信息"),
		REGISTER_REGEX("REGISTER_REGEX","注册时验证手机号不能做用户名的正则"),
		CREDIT_LIMIT_MIN("CREDIT_LIMIT_MIN", "银行卡验证通过默认信用额度"),
		CREDIT_LIMIT_MAX("CREDIT_LIMIT_MAX", "最大信用额度"),
		CREDITOR_AVCBASE_APR_3("CREDITOR_AVCBASE_APR_3", "美分期3期基准年后利率"),
		CREDITOR_AVCBASE_APR_6("CREDITOR_AVCBASE_APR_6", "美分期6期基准年后利率"),
		CREDITOR_AVCBASE_APR_9("CREDITOR_AVCBASE_APR_9", "美分期8期基准年后利率"),
		CREDITOR_AVCBASE_APR_12("CREDITOR_AVCBASE_APR_12", "美分期12期基准年后利率"),
		MFQ_APP_JPUSH_CONFIG("MFQ_APP_JPUSH_CONFIG", "美分期APP极光推送配置"),
		MERCHANT_APP_JPUSH_CONFIG("MERCHANT_APP_JPUSH_CONFIG", "商户端美分期APP极光推送配置"),
		MFQ_PERIODS_CONFIG("MFQ_PERIODS_CONFIG", "美分期分期期数配置"),
		MFQ_RECH_CONFIG("MFQ_RECH_CONFIG","美分期充值配置"),
		OVERDUE_FINE_PRICE_FEE("OVERDUE_FINE_PRICE_FEE","逾期罚息配置"),
		MFQ_SERVICE_TYP_LIST("MFQ_SERVICE_TYP_LIST","机构服务类型列表"),
		MFQ_ORDER_VALID_TIME("MFQ_ORDER_VALID_TIME","订单未支付状态过期时间（秒）"),
		QK_FUND_CONFIG("QK_FUND_CONFIG","乾康资金交互配置"),
		PF_CURR_FUND_CHANNEL("PF_CURR_FUND_CHANNEL","平台当前使用的资金渠道"),
		LIVING_AUTH_CALL_BACK_CONFIG("LIVING_AUTH_CALL_BACK_CONFIG","活体认证回调配置")
		;
		/*医美分期 end*/
		private String value;
		private String description;

		SysParamKeyEnum(String value, String description) {
			this.value = value;
			this.description = description;
		}

		public String getDescription() {
			return description;
		}

		public String getValue() {
			return value;
		}
	}

	/**
	 * @ClassName: BorrowTypeEnum
	 * @Description: 借款项目类型
	 * @author ready likun_557@163.com
	 * @date 2014-8-15 上午9:20:57
	 */
	public enum BorrowTypeEnum {
		TYPE1(1, "精英圆梦贷"), TYPE2(2, "发展助业贷"), TYPE3(3, "尊贵白金贷"), TYPE4(4, "易借贷");
		private Integer type;
		private String name;

		BorrowTypeEnum(Integer type, String name) {
			this.type = type;
			this.name = name;
		}

		public Integer getType() {
			return type;
		}

		public String getName() {
			return name;
		}

	}

	/**
	 * <b>description</b>：借款审批状态 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum BorrowApprovalStatusEnum {
		tongguo(1, "通过"), huitui(2, "回退"), jujue(3, "拒绝");
		private Integer status;
		private String description;

		BorrowApprovalStatusEnum(Integer status, String description) {
			this.status = status;
			this.description = description;
		}

		public Integer getStatus() {
			return status;
		}

		public void setStatus(Integer status) {
			this.status = status;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}
	}

	/**
	 * <b>description</b>：满标待审状态 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum FullBidApprovalStatusEnum {
		tongguo(1, "放标"), jujue(3, "流标");
		private Integer status;
		private String description;

		FullBidApprovalStatusEnum(Integer status, String description) {
			this.status = status;
			this.description = description;
		}

		public Integer getStatus() {
			return status;
		}

		public void setStatus(Integer status) {
			this.status = status;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}
	}

	/**
	 * 用户联系人类型
	 * 
	 * @ClassName: UserContactDirectTypeEnum
	 * @Description: TODO
	 * @author ready likun_557@163.com
	 * @date 2014-8-20 下午9:07:31
	 */
	public enum UserContactDirectTypeEnum {
		kinship(1, "亲属"), other(2, "其他联系人");
		private Integer directType;
		private String description;

		UserContactDirectTypeEnum(Integer directType, String description) {
			this.directType = directType;
			this.description = description;
		}

		public Integer getDirectType() {
			return directType;
		}

		public String getDescription() {
			return description;
		}
	}

	/**
	 * @ClassName: IdentityVerifyCertTypeEnum
	 * @Description: 实名认证类型
	 * @author ready likun_557@163.com
	 * @date 2014-8-21 上午10:41:44
	 */
	public enum IdentityVerifyCertTypeEnum {
		idcard(1, "身份证");
		private Integer certType;
		private String description;

		IdentityVerifyCertTypeEnum(Integer certType, String description) {
			this.certType = certType;
			this.description = description;
		}

		public Integer getCertType() {
			return certType;
		}

		public String getDescription() {
			return description;
		}
	}

	/**
	 * <b>description</b>：投标是否有效 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum InvestEnableEnum {
		YES(1, "有效"), NO(2, "无效");
		private Integer enable;
		private String description;

		InvestEnableEnum(Integer enable, String description) {
			this.enable = enable;
			this.description = description;
		}

		public Integer getEnable() {
			return enable;
		}

		public String getDescription() {
			return description;
		}
	}

	/**
	 * <b>description</b>：费用计算方式 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum CalcModeEnum {
		SAVE_CAPITAL_INTEREST(1, "等额本息"), ON_MONTH_INTEREST(2, "每月付息，到期还本");
		private Integer mode;
		private String description;

		CalcModeEnum(Integer mode, String description) {
			this.mode = mode;
			this.description = description;
		}

		public Integer getMode() {
			return this.mode;
		}

		public String getDescription() {
			return description;
		}

		public static CalcModeEnum getCalcModeEnum(Integer mode) {
			if (mode == null) {
				return null;
			} else {
				CalcModeEnum[] ems = CalcModeEnum.values();
				for (CalcModeEnum calcModeEnum : ems) {
					if (calcModeEnum.getMode().equals(mode)) {
						return calcModeEnum;
					}
				}
				return null;
			}
		}
	}

	/**
	 * <b>description</b>：是否有逾期记录 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum HasOverdueEnum {
		NO(0, "否"), YES(1, "是");
		private Integer value;
		private String description;

		HasOverdueEnum(Integer value, String description) {
			this.value = value;
			this.description = description;
		}

		public Integer getValue() {
			return value;
		}

		public String getDescription() {
			return description;
		}
	}

	/**
	 * <b>description</b>：投资中的资金来源 <br>
	 * <b>time</b>：2014-8-22 下午7:14:54 <br>
	 * <b>author</b>： ready likun_557@163.com
	 */
	public enum CapitalSourceTypeEnum {
		balance(1, "可用余额账户"), voucher(2, "充值券"), reward(3, "奖金金额");
		CapitalSourceTypeEnum(Integer value, String description) {
			this.value = value;
			this.description = description;
		}

		// 值
		private Integer value;
		// 描述
		private String description;

		public Integer getValue() {
			return value;
		}

		public String getDescription() {
			return description;
		}
	}

	public static String PAYORDER_RESULT_CODE = "resultCode";
	public static String PAYORDER_RESULT_MSG = "resultMsg";
}
